import App from './App'

// xyg20039======45=

const uniacid = 45;
const pathname = "";
// uni.clearStorage();


import storage from "@/custom/storage.js";
uni.storage = storage;

// #ifndef H5
uni.setStorageSync("uniacid", uniacid);
uni.storage.set("pathname", pathname)
// #endif



// #ifdef H5
// localStorage.setItem("uniacid",uniacid);
if (localStorage.getItem("uniacid")) {
	uni.setStorageSync("uniacid", localStorage.getItem("uniacid"));
} else {
	uni.setStorageSync("uniacid", uniacid);
}
// #endif


import graceJS from "@/Grace6/js/grace.js";
uni.gJs = graceJS;

import router from "@/custom/router.js";
uni.router = router;

// #ifdef H5

uni.storage.set("pathname", window.location.pathname.replace(/\W/g, ""))
// #endif


import pay from "@/custom/pay.js";
uni.$pay = pay;


import location1 from "@/custom/location.js";
uni.location = location1;

// 引入h5分享
// #ifdef H5
import jswx from '@/custom/jswx'
uni.$jswx = jswx;
// #endif

import http from '@/custom/http/index.js'
uni.gPost = http.post;

import store from './store'

// #ifndef VUE3
import Vue from 'vue'
Vue.config.productionTip = false

Vue.prototype.$onLaunched = new Promise(resolve => {
	Vue.prototype.$isResolve = resolve
})

App.mpType = 'app'
const app = new Vue({
	...App,
	store
})
app.$mount()
// #endif

// #ifdef VUE3
import {
	createSSRApp
} from 'vue'
export function createApp() {
	const app = createSSRApp(App)

	app.config.globalProperties.$onLaunched = new Promise(resolve => {
		app.config.globalProperties.$isResolve = resolve
	})
	app.use(store)
	return {
		app
	}
}
// #endif